package com.hk.huakangcompany.mapper;

import com.hk.huakangcompany.model.OnlineMessage;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author: zhe
 * @Date: 2021/6/21 16:23
 * @Statement: 在线留言Mapper层接口
 */
public interface OnlineMessageMapper extends BaseMapper<OnlineMessage> {

    @Override
    List<OnlineMessage> findAll(OnlineMessage onlineMessage);

    @Override
    int count(OnlineMessage onlineMessage);


    @Override
    OnlineMessage findById(Integer id);

    @Insert("insert into online_message value " +
            "(null,#{title},#{email},#{content},#{gmtCreate},#{gmtModified})")
    @Override
    int save(OnlineMessage onlineMessage);

    @Update("update online_message set " +
            "title=#{title},email=#{email},content=#{content},gmt_modified=#{gmtModified} " +
            "where id = #{id} ")
    @Override
    int update(OnlineMessage onlineMessage);

    @Delete("delete from online_message where id = #{id} ")
    @Override
    int delete(Integer id);
}
